package com.kpmg.datalake.web.config;

import com.kpmg.datalake.web.interceptor.AuthenticationInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author Alex.zhao [alex.zhao@kpmg.com]
 * @since Created on azhao6 on 2018-06-27 11:38:36
 */
@Configuration
public class AuthenticationConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
      registry.addInterceptor(new AuthenticationInterceptor()).addPathPatterns("/**")
          .excludePathPatterns("/swagger/*", "/api-docs/*", "/api/*", "/userManager/checkLogin",
              "/plsql/**", "/pkgauto/getVersionInfo", "/pkgauto/downloadVersion",
              "/pkgauto/pkgDownload", "/userManager/getSaltForUser");
    }
}
